from fastapi import APIRouter

from app.corelibs.http_response import partner_success
from app.schemas.hrms.hrms_schemas import DutySchemas
from app.services.hrms.hrms_services import DutyService

router = APIRouter()


@router.post('/dutyList', description="岗位列表")
async def duty_list(params: DutySchemas):
    data = await DutyService.list(params)
    return partner_success(data)


@router.post('/dutySave', description="保存岗位")
async def save_or_update(params: DutySchemas):
    data = await DutyService.save_or_update(params)
    return partner_success(data)


@router.post('/dutyDeleted', description="删除岗位")
async def deleted(params: DutySchemas):
    data = await DutyService.deleted(params)
    return partner_success(data)
